#ifndef CHATUSERWID_H
#define CHATUSERWID_H

#include <QWidget>
#include "userdata.h"
namespace Ui {
class ChatUserWid;
}

class ChatUserWid : public QWidget
{
    Q_OBJECT

public:
    explicit ChatUserWid(QWidget *parent = nullptr);
    ~ChatUserWid();
    int uid() const;
    QString name() const;
    void setRedPointVisible(bool visible);
    void setChatInfo(std::shared_ptr<FriendInfo>);
signals:
    void sig_clicked(std::shared_ptr<FriendInfo>);

private:
    Ui::ChatUserWid *ui;
    bool _redPointVisible;
    std::shared_ptr<FriendInfo> _friendInfo;

protected:
    virtual void paintEvent(QPaintEvent *event) override;

    // QWidget interface
protected:
    virtual void mousePressEvent(QMouseEvent *event) override;
};

#endif // CHATUSERWID_H
